<?php
/**
 * Created by PhpStorm.
 * User: CS
 * Date: 2018/11/12
 * Time: 21:56
 */
require 'conn.php';
$id = $_SESSION['id'];
//产生随机令牌
$key = mt_rand(111111,999999);
$sql = "update `gm_index` set `xiafen` = $key where `id` = $id";
$re = mysqli_query($con,$sql);
if($re){
    echo $key;
}else{
    echo 0;
}